{% extends "bootstrap/base.html" %}

{% block title %}
All-in
{% endblock %}

{% block navbar %}
<div class="nav navbar-inverse" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" >
                <span class="sr-only">Toggle</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/"> ALL-IN </a>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li>
                    <a href="/">Home</a>
                </li>

            </ul>
            <ul class="nav navbar-nav navbar-right">
                {% if current_user.is_authenticated %}
                <li>
                    <a href="{{url_for('ckeditor')}}">写文章</a>,
                </li>
                <li>
                    <a href="{{url_for('profile')}}">{{current_user.username}}</a>
                </li>
                <li>
                    <a href="{{url_for('logout')}}">注销</a>
                </li>

                {% else %}
                <li>
                    <a href="{{url_for('ckeditor')}}">写文章</a>,
                </li>
                <li>
                    <a href="{{url_for('user_login')}}">登陆</a>,
                </li>
                {% endif %}
            </ul>
        </div>

    </div>

</div>

{% endblock %}

{% block content %}
<div class="container">
    {% for m in get_flashed_messages() %}
    <div class="alert alert-warning">
        <button class="close" type="button" data-dismiss="alert">&times;</button>
        {{m}}
    </div>
    {% endfor %}
    {% block page_content %}

    {% endblock %}
</div>
{% endblock %}